//
//  MqFindBikeShopDetailHeaderView.m
//  Meiqi
//
//  Created by lanou on 16/1/15.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqFindBikeShopDetailHeaderView.h"

@implementation MqFindBikeShopDetailHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview];
    }
    return self;
}

- (void)addSubview
{
    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    [self addSubview:_scrollView];
    
    _picView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 250)];
    //_picView.backgroundColor = [UIColor greenColor];
    [_scrollView addSubview:_picView];
    
    _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 255, kScreenWidth - 80, 30)];
    //_nameLabel.backgroundColor = [UIColor cyanColor];
    [_scrollView addSubview:_nameLabel];
    
    _cate_nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 80, 255, 70, 30)];
    _cate_nameLabel.layer.cornerRadius = 15;
    _cate_nameLabel.layer.masksToBounds = YES;
    _cate_nameLabel.textColor = [UIColor whiteColor];
    //_cate_nameLabel.backgroundColor = [UIColor redColor];
    [_scrollView addSubview:_cate_nameLabel];
    
    _starsLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 290, 100, 20)];
    for (int i = 0; i < 5; i ++) {
        UIImageView *starImage = [[UIImageView alloc] initWithFrame:CGRectMake(0 + 20 * i, 0, 20, 20)];
        starImage.image = [UIImage imageNamed:@"icon_shop_detail_noRate@3x"];
        starImage.tag = 50 + i;
        [_starsLabel addSubview:starImage];
    }
    [_scrollView addSubview:_starsLabel];
    
    _evaluateLabel = [[UILabel alloc] initWithFrame:CGRectMake(120, 290, kScreenWidth - 130, 20)];
    //_evaluateLabel.backgroundColor = [UIColor cyanColor];
    [_scrollView addSubview:_evaluateLabel];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 320, kScreenWidth, 1)];
    //label.backgroundColor = [UIColor blackColor];
    [_scrollView addSubview:label];
    
    
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(10, 330, 30, 30)];
    imageV.image = [UIImage imageNamed:@"icon_shop_redlocation@3x"];
    [_scrollView addSubview:imageV];
    
    _addressButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _addressButton.frame = CGRectMake(10, 330, kScreenWidth - 60, 30);
    [_addressButton setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    //_addressButton.backgroundColor = [UIColor greenColor];
    _addressButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    
    [_scrollView addSubview:_addressButton];
    
    _telephoneButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _telephoneButton.frame = CGRectMake(kScreenWidth - 50, 330, 40, 30);
    [_telephoneButton setImage:[UIImage imageNamed:@"icon_shop_redphone@3x"] forState:(UIControlStateNormal)];
    //_contactButton.backgroundColor = [UIColor redColor];
    [_scrollView addSubview:_telephoneButton];
    
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 370, kScreenWidth, 30)];
    label1.text = @"车店详情";
    [self addSubview:label1];
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 370, 2, 30)];
    //label2.backgroundColor = [UIColor redColor];
    [_scrollView addSubview:label2];
    
    _business_hoursLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 410, kScreenWidth - 20, 50)];
    _business_hoursLabel.numberOfLines = 0;
    //_business_hoursLabel.backgroundColor = [UIColor cyanColor];
    [_scrollView addSubview:_business_hoursLabel];
    
    
    _brandsLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 470, kScreenWidth - 20, 50)];
    //_brandsLabel.backgroundColor = [UIColor greenColor];
    _brandsLabel.numberOfLines = 0;
    [_scrollView addSubview:_brandsLabel];
    
    
    _descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, _brandsLabel.bottom + 10, kScreenWidth - 20, 50)];
    //_descriptionLabel.backgroundColor = [UIColor redColor];
    _descriptionLabel.numberOfLines = 0;
    [_scrollView addSubview:_descriptionLabel];
    
    
}

@end
